package behavioral.mediator;

public class Mediator extends AbstractMediator {
    private AbstarctColleague a;
    private AbstarctColleague b;

    public Mediator(AbstarctColleague a, AbstarctColleague b) {
        super(a, b);
        this.a = a;
        this.b = b;
    }

    @Override
    public void effectA() {
        int count = this.b.getCount();
        this.a.setCount(count * 100);
        System.out.println("A　Count :" + a.getCount());
    }

    @Override
    public void effectB() {
        int count = this.a.getCount();
        this.b.setCount(count + 100);
        System.out.println("B　Count :" + b.getCount());
    }
}
